

import os
import unittest

from utils import path_utils

class TestGetParentDir(unittest.TestCase):
    
    def testWithFile(self, path='c:\\windows\\system32\\kernel32.dll',
                     parent='c:\\windows\\'):
        parent_ = path_utils.getParentDir(path)
        self.assertEqual(parent, parent_)
        
    def testWithDir(self, path='c:\\windows\\system32\\',
                     parent='c:\\windows\\'):
        parent_ = path_utils.getParentDir(path)
        self.assertEqual(parent, parent_)
        
    def testWithNonExist(self):
        self.testWithDir('U:\\main\\lol\\', 'U:\\main\\')
        
    def testWithSlashes(self):
        self.testWithDir('/root/home/Desktop', '/root/home/')
    
    
if __name__ == '__main__':
    unittest.main()




